package com.linewell.license.demo.designPattern.createPattern.FactotyPattern.car;

import com.linewell.license.demo.designPattern.createPattern.FactotyPattern.AbstractFactory;
import com.linewell.license.demo.designPattern.createPattern.FactotyPattern.cycle.Cycle;

/**
 * @Title: springBootDemo
 * @description:
 * @author: hyuhuang@linewell.com
 * @since:2019/11/22
 */
public class CarFactory extends AbstractFactory {
    @Override
    protected Cycle getCycle(String name) {
        return null;
    }

    public Car getCar(String name){
        if ("BMW".equalsIgnoreCase(name)){
            return new BMW();
        } else if ("Mercedes".equalsIgnoreCase(name)){
            return new Mercedes();
        }
        return new Car();
    }
}
